#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2021-11-30 10:53
# @Author : huabao.tan
# @File : login_page.py
# @Software: PyCharm
from base.base_page import BasePage
from selenium import webdriver
from ddt import ddt, file_data

@ddt
class LoginPage(BasePage):
    # 页面URL
    # 页面元素
    # 页面业务流程
    username = ('name', 'username')
    password = ('name', 'password')
    butten = ('xpath', '//button[@type="button"]')

    @file_data('../data/element.yaml')
    def login(self, use, pwd, url):
        self.open(self.url)
        self.input(self.username, use)
        self.input(self.password, pwd)
        self.click(self.butten)
        self.wait(3)



if __name__ == '__main__':
    lp = LoginPage("Chrome")
    lp.login(use, pwd, url)